#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a[1000],j,k,n=0,Doubles;
    for (;;n++)
    {
        scanf("%d",&a[n]);
        if (a[0]==-1)break;
        if (a[n]==0)
        {
               Doubles=0;
               for (j=0;j<n;j++)for (k=0;k<n;k++)if (a[j]*2==a[k]){Doubles++;break;}
               printf("%d\n",Doubles);
               n=-1;
        }
    }
    return 0;
}

